W11: Input devices


This is Week 11. Input devices, we are going to use the electronic circuit from week 08. During several weeks we have been working with the board we design. Now we have to add some new things to it, i'm talking about input devices, this devices are use to make a component, like a screen, work. So, lets start and see what comes along this week, of course hoping for the best and trying to enjoy as much as I can! Let me share with all of you what are my new assignments:

This week assignmets are:

Group assignments:

Individual assignments:

In this week assignments i'm using:

Machines/Equipment Components
  • Multimeter
  • Oscilloscope
  • PCB board
  • Dupont cables
  • LCD screen.
  • Max 30102 sensor
  • Potentiometer

Multimeter

What is a Multimeter?

A digital multimeter (DMM) is a versatile electronic device used to measure various electrical properties, including voltage, current, and resistance. The device displays the measurements on a digital screen, making it easy to read and understand the results accurately. Digital multimeters have replaced traditional analog meters and offer higher accuracy, reliability, and better handling of impedance.

Uses of multimeter

A multimeter is used to troubleshoot electrical problems on motors, circuits, power supplies, and switches. It is the most common tool used by technicians to troubleshoot electrical issues. A few examples of use cases are:

Types of multimeter

Data from: Multimeter



Oscilloscope

An oscilloscope:

Is a tool that displays electric voltage signals over time as a waveform graph. The vertical axis (Y) represents the voltage measurement, and the horizontal axis (X) represents time. Sometimes, a Z-axis is displayed as color grades or brightness that represents the intensity of the voltage. The voltage signals are displayed as wavelengths oscillating or repeating variations over time. While oscilloscopes are most commonly used by engineers or electrical technicians, most people will see oscilloscopes in the medical field, whether in person or through movies or television. Typically, the oscilloscope displays a medical patient's heartbeat or brain waves.

The graph on an oscilloscope can reveal important information:

Data from: Oscilloscope


Input devices

Is a mechanical device used to control an electrical circuit in which the operator manually presses a button to actuate an internal switching mechanism. They come in a variety of shapes, sizes, and configurations, depending on the design requirements.


Data from: Push button

Is an integrated pulse oximetry and heart-rate monitor module. It includes internal LEDs, photodetectors, optical elements, and low-noise electronics with ambient light rejection. It provides a complete system solution to ease the design-in process for mobile and wearable devices.


Data from: Max30102

Is a manually adjustable variable resistor with 3 terminals. Two of the terminals are connected to the opposite ends of a resistive element, and the third terminal connects to a sliding contact, called a wiper, moving over the resistive element. It functions as a variable resistance divider.


Data from: Potentiometer


Group assignments


A). Probe an input device's analog levels and digital signals.

Before testing some input devices I got to make sure to know about them, I mean understand the hardware and technical information of each on of them and learn how to connect them. After that test the analog and digital level of both device. The input devices i'm using are:

A1). How to wire a potentiometer

  1. Identify the 3 main terminals sticking out of the middle of the pot.
  2. The first terminal, or terminal 1, is your ground. The middle terminal, or terminal 2, is the input signal for the pot. The third terminal, or terminal 3, is your output signal. The shaft on top controls a small ring attached to the second terminal. Turning it controls how low or high the input is.

  3. Read the resistance numbers printed on your pot to see what range you can achieve.
  4. Pots are rarely used to control signals that are more than a couple of volts, but the amount of resistance that they provide is important. The higher the range, the more control you’ll have over your device. The number on the front of the pot tells the highest level of resistance that the pot can achieve. So a 200K pot can provide a maximum of 200,000 ohms of resistance.

  5. Set your pot on a flat surface with the 3 terminals facing you.
  6. Place your pot down on a flat surface next to your electronic device. If you know that you’re going to install the pot in a particular location, start there. Turn the 3 terminals so that they’re facing you. Remove any panels on your electronic device to expose the backside of any input or output ports. Unplug your electronic device before opening any panels or soldering any connections. You don’t want to get electrocuted or damage your device permanently.

  7. Measure and strip any wires that you’re going to be using.
  8. Place your pot down on a flat surface next to your electronic device. If you know that you’re going to install the pot in a particular location, start there. Turn the 3 terminals so that they’re facing you. Remove any panels on your electronic device to expose the backside of any input or output ports. Unplug your electronic device before opening any panels or soldering any connections. You don’t want to get electrocuted or damage your device permanently.

  9. Test your pot to make sure that it’s working with a voltmeter/multimeter and adjust the signal on your device by turning the shaft.
  10. Connect the voltmeter's terminals to the input and output terminals on the pot. Turn the voltmeter on and turn the dial to feed a signal. Turn the knob on top of your pot to adjust the signal. If the signal reading on the voltmeter goes up and down when you turn the knob, your potentiometer works. Turn your electronic device on and feed a signal to the pot by playing some music, hitting a guitar note, or turning a light on. Twist the shaft to the left to turn the audio or light down. Twist the shaft to the right to raise the volume or level of light. Twist the shaft all the way to the left to turn the output off.

Data from: Wiring a potentiometer

A1.1). How does it work?

Before makink any test, I had to wire the potentiometer and connecting the multimeter and DC power supply:

A2). How to wire a push button.

Connect three wires to the board. The first two, red and black, connect to the two long vertical rows on the side of the breadboard to provide access to the 5 volt supply and ground. The third wire goes from digital pin 2 to one leg of the pushbutton. That same leg of the button connects through a pull-down resistor (here 10K ohm) to ground. The other leg of the button connects to the 5 volt supply. When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin is connected to ground (through the pull-down resistor) and we read a LOW. When the button is closed (pressed), it makes a connection between its two legs, connecting the pin to 5 volts, so that we read a HIGH.

You can also wire this circuit the opposite way, with a pullup resistor keeping the input HIGH, and going LOW when the button is pressed. If so, the behavior of the sketch will be reversed, with the LED normally on and turning off when you press the button. If you disconnect the digital I/O pin from everything, the LED may blink erratically. This is because the input is "floating" - that is, it will randomly return either HIGH or LOW. That's why you need a pull-up or pull-down resistor in the circuit.

Data from: Push button

A2.1). How does it work?

After the circuit is ready I:


Individual assignments


A). Measure something: add a sensor to a microcontroller board that you have designed and read it.

A1). Pin diagrams

This is the pin diagram of the XIAO_ESP32S3 and the circuit board just to have a better understanding on were to connect the input devices


A2).Max30102 sensor

This is some information about the max30102 sensor.

Applications

The MAX30102 operates on a single 1.8V power supply and a separate 3.3V power supply for the internal LEDs. Communication is through a standard I2C-compatible interface.

Benefits and Features

Data from: Max30102

A3). How does the Max30102 works

Principle

The MAX30102 works by shining both lights onto the finger or earlobe (or essentially anywhere where the skin isn’t too thick, so both lights can easily penetrate the tissue) and measuring the amount of reflected light using a photodetector. This method of pulse detection through light is called Photoplethysmogram. The working of MAX30102 can be divided into two parts: Heart Rate Measurement and Pulse Oximetry (measuring the oxygen level of the blood).

Heart Rate Measurement

The oxygenated hemoglobin (HbO2) in the arterial blood has the characteristic of absorbing IR light. The redder the blood (the higher the hemoglobin), the more IR light is absorbed. As the blood is pumped through the finger with each heartbeat, the amount of reflected light changes, creating a changing waveform at the output of the photodetector. As you continue to shine light and take photodetector readings, you quickly start to get a heart-beat (HR) pulse reading.

Pulse Oximetry

Pulse oximetry is based on the principle that the amount of RED and IR light absorbed varies depending on the amount of oxygen in your blood.

Data from: How does it work

B). Testing the Max30102.

B1). Connecting the Max30102 to the cirtuit board.

After verifying some information about the Max3102 sensor and as my next part of the assignment, I wire it to the circuit board I design a few weeks ago. For this part i'm going to need 4 wires and connect them to the next pins:

B2). Test results

After wiring the max30102 sensor, we have to use some libraries and upload them to the Arduino IDE. In the file section you can download the libraries I use to test the sensor. Remember its important to take time and verify the code works properly. Now in the next videos you can see the results I got of the measurements of the sensor.

Result #1

In this first result you can see the heart rate and SPO2 at the same time every 4 seconds.

Result #2

In the second test the measures are the heart beat and SPO2 continuously. It also shows when the sensor is not detecting the finger.

Result #3

In the third test the measures the heart beat as a number and as a graph. I this one I use the serial plotter provided by the Arduino IDE (go to tools and select Serial plotter).

Result #4

For my final result I decided to test the heart beat and SPO2 and compare it with a oximeter. I did this to verify how accurate the Max30102 is.


P.I.C.N.I.C section


A). Push button circuit

B). Max30102 sensor


Final part


Files

In this part you can download the arduino libraries I use during this week assignments.

Conclusions and recomendations

What did I learn in this week?